package com.nbgs.demo.common;

import jxl.Sheet;
import jxl.Workbook;
import jxl.read.biff.BiffException;

import java.io.File;
import java.io.IOException;

public class ExcelUtils {

    public static Sheet read(File file){

        System.out.println("开始读取excel文件："+file);

        try {
            Workbook workbook = Workbook.getWorkbook(file);

            Sheet sheet = workbook.getSheet(0);

            return sheet;

        } catch (IOException | BiffException e) {
            throw new IllegalStateException(e);
        }

    }

}
